package com.example.hiworld

import android.os.Bundle
import android.util.Log
import io.flutter.embedding.android.FlutterActivity

class MainActivity: FlutterActivity() {
    private var plugins: MytestPlugins? = null

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        plugins = MytestPlugins.registerWith(this, flutterEngine!!.dartExecutor.binaryMessenger)
    }

    override fun onResume() {
        super.onResume()
        Thread {
            try {
                Thread.sleep(5000)
            } catch (e: Exception) {
            }
            runOnUiThread { plugins!!.invokeFlutter() }
        }.start()
    }
}
